#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <cwindow.h>

#define High 15 
#define Width 20

int ball_x, ball_y;
int ball_vx, ball_vy;
int position_x, position_y;
int ridus;
int left, right;
int canvas[High][Width] = { 0 };

void gotoxy(int x, int y)
{
	HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
	COORD pos;
	pos.X = x;
	pos.Y = y;
	SetConsoleCursorPosition(handle, pos);
}

void startup()
{
	ridus = 5;
	position_x = High - 1;
	position_y = Width / 2;
	left = position_y - ridus;
	right = position_y + ridus;

	ball_x = position_x - 1;
	ball_y = position_y;
	ball_vx = -1;
	ball_vy = 1;
	canvas[ball_x][ball_y] = 1;

	int k, i;
	for (k = left; k <= right; k++)
		canvas[position_x][k] = 2;

	for (k = 0; k < Width; k++)
		for (i = 0; i < High / 4; i++)
			canvas[i][k] = 3;
}